﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml.Linq;

namespace MbWsClient.Classes
{
    public class Metadata
    {
        public Metadata(Guid id)
        {
            SetData(id);
        }

        private void SetData(Guid id)
        {
            FileInfo[] files = AppSettings.MetadataCacheDir.GetFiles(id.ToString() + "*");
            if (files.Length == 1)
            {
                XDocument doc = XDocument.Load(files[0].FullName);
                SetData(doc);
            }
            else
            {
                // TODO: MetadataItem metadataItem = AppSettings.MbService.GetMetadata(id);
            }
        }

        private void SetData(XDocument metadata)
        {
            throw new NotImplementedException();
        }

        public string Overview { get; private set; }
    }
}
